import request from "@/utils/request";
import { Result } from "./type/globale";
import { WechatCode } from "./type/order";

//创建订单
export const postOrderAPI=(hoscode:string,scheduleId:string,patientId:number)=>request.post<any,Result<number>>(`/order/orderInfo/auth/submitOrder/${hoscode}/${scheduleId}/${patientId}`)

//取消订单
export const getCancelOrderAPI=(orderId:string)=>request.get<any,Result<boolean>>(`/order/orderInfo/auth/cancelOrder/${orderId}`)

//生成订单二维码
export const getWechatCodeAPI=(orderId:string)=>request.get<any,Result<WechatCode>>(`/order/weixin/createNative/${orderId}`)


//查询支付状态
export const getPayStatusAPI=(orderId:string)=>request.get<any,Result<boolean>>(`/order/weixin/queryPayStatus/${orderId}`)